import schema
class IHRMAssertUtils:
    @classmethod
    def assert_login(cls, resp, success, code, msg):
        self.asserteEqual(resp.status_code, 200)
        schema = {
            'type': 'object',
            'required': ['success', 'code', 'message', 'data'],
            'properties': {
                'success': {
                    'type': 'boolean',
                    'const': success
                },
                'code': {
                    'type': 'integer',
                    'const': code
                },
                'message': {
                    'type': 'string',
                    'const': msg
                }
            }
        }
        jsonschema.validata(instance=resp.json(), schema=schema)

    @classmethod
    def assert_add_emp(cls, self, resp, success, code, message):
        self.assertEqual(resp.status_code, 200)
        self.assertEqual(resp.json().get('success'), success)
        self.assertEqual(resp.json().get('code'), code)
        self.assertEqual(resp.json().get('message'), message)


